package com.java.base.exercise.proxy.dynamicproxy.dynamicinterface;

import com.google.common.collect.Maps;
import com.java.base.exercise.designmode.builder.Person;
import com.java.base.exercise.proxy.dynamicproxy.JDKDynamicInvocationHandler;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * @Author RenPu
 * @Date 2022/1/5 12:13
 * @Version 1.0
 * @Description:
 **/
public class test {

    public static void main(String[] args) {

//        HelloService helloServiceImple = new HelloServiceImple();
//
//        JDKDynamicInvocationHandler handler = new JDKDynamicInvocationHandler(helloServiceImple);
//        HelloService helloService=(HelloService)handler.getProxy();
//        helloService.say();


        CopyOnWriteArrayList<Object> objects = new CopyOnWriteArrayList<>();
        Person person = new Person("lisi",2);
        objects.add(person);
        person.setName("465465465000");
        System.out.println("CopyOnWriteArrayList   .............."+objects);




        Map<String, String> map = Maps.newHashMapWithExpectedSize(7);
        map.put("111","2222");
        map.put("55","33333");
        map.put("77","6666");
        map.put("1","7777");
        map.put("2","8888");
        map.put("3","99999");

        System.out.println("之前..........."+map);


        int expectedSize=8;

        int d=(int)((float)expectedSize / 0.75F + 1.0F);

        System.out.println(d);





        Map<String, String> map1 = Collections.unmodifiableMap(map);


        System.out.println("之后吱吱吱吱..........."+map1);



    }


}
